#!/usr/env/bin python
"""
:mod:`pynchon.bio.plot.fig`
===========================
"""

def chunk2d(chunk, atoms):
    
    #coords = [[-2,0,0],[2,0,0],[1,2,99],[-1,-2,99]]
    coords = chunk
    #x= [-2,2,1,-1]
    #y= [0,0,+2,-2]
    
    fig = pylab.figure()
    ax = fig.add_subplot(111)
    
    #ax.scatter(x,y)

    ax.spines['left'].set_position('center')
    ax.spines['right'].set_color('none')
    ax.spines['bottom'].set_position('center')
    ax.spines['top'].set_color('none')
    
    
    
    # edges
    for source in coords:
        for destination in coords:
            if (source == destination).all():
                continue
            elif source[1] < destination[1]:
                ax.annotate('', source[:2], destination[:2],
                            arrowprops=dict(arrowstyle='wedge,tail_width=0.3', \
                                            fc="k", ec="k"))
            elif source[1] > destination[1]:              
                ax.annotate('', source[:2], destination[:2],
                            arrowprops=dict(arrowstyle='wedge,tail_width=0.3', \
                                            fc="k", ec="w"))
    ax.set_xlim((-5.0, 5.0))
    ax.set_ylim((-5.0, 5.0))
    ax.grid(True)
    pylab.show()
    
if __name__ == '__main__':
    pass
    #canonical_tetrahedron(None, None)

